export const GetUsers = () => {
    return fetch(BASH_URL).then(res => res.json())
}

const GetParam = (obj) => {
    return Object.keys(obj).map(key => {
        return `${key}=${obj[key]}`
    }).join("&")
}

export const EdiUser = (data,id) => {
    return fetch(`${BASH_URL}/${id}`, {
        method: "PATCH",
        headers: {
            "content-type": "application/json"
        },
        body: JSON.stringify(data)
    }).then(res => res.json())
}

export const AddUser = ()=>{

    return fetch(`${BASH_URL}`,{
        method:"POST",
        headers:{
            "content-type":"application/json"
        },
        body:JSON.stringify(data)
    })
}